package newKe;

import java.util.Scanner;

public class HJ6 {
    /**
     * 功能:输入一个正整数，按照从小到大的顺序输出它的所有质因子（重复的也要列举）（如180的质因子为2 2 3 3 5 ）
     */
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();

        int x = (int) Math.sqrt(a)+1;

        for(int i=2;i<=x;i++){
            while (a%i == 0){
                System.out.print(i+" ");
                a = a/i;
            }
        }

        System.out.println(a == 1?"":a);
    }
}
